package org.gwt.pluginframework.exceptionhandler.client;

import org.gwt.pluginframework.common.IPluginManager;
import org.gwt.pluginframework.common.PluginManager;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;

public class ExceptionHandler implements EntryPoint {
	public void onModuleLoad() {
		IPluginManager manager = new PluginManager();

		long start = System.currentTimeMillis();
		PopupPanel panel = new PopupPanel();
		Label label = new Label("Loading...");
		panel.add(label);
		panel.show();
		
		manager.registerPlugin(new ExceptionTriggerPlugin());
		manager.registerPlugin(new ExceptionHandlingPlugin());
		
		manager.run();

		label.setText("Loaded in " + (System.currentTimeMillis() - start) + " ms");
	}
}
